//
//  TravelSearchCollectionViewCell.m
//  ToWhere
//
//  Created by dllo on 15/11/18.
//  Copyright © 2015年 www.TE.com. All rights reserved.
//

#import "TravelSearchCollectionViewCell.h"

@implementation TravelSearchCollectionViewCell

- (void)dealloc
{
    [_name release];
    [_label release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];
    if (self) {
        self.label = [[UILabel alloc] init];
        self.label.textAlignment = NSTextAlignmentCenter;
        self.label.layer.cornerRadius = 10 *kWidth;
        self.label.backgroundColor = [UIColor colorWithRed:0.882 green:0.899 blue:0.927 alpha:1.000];
        self.label.font = [UIFont systemFontOfSize:15 *kWidth];
        self.label.textColor = [UIColor colorWithWhite:0.193 alpha:0.8];
        [self.contentView addSubview:_label];
        [_label release];
    }
    return self;
}
- (void)layoutSubviews{

    [super layoutSubviews];
    self.label.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}
- (void)setName:(NSString *)name{

    if (_name != name) {
        [_name release];
        _name = [name copy];
    }
    self.label.text = name;

}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
